package com.taxshare.purchaser.controller;

import com.taxshare.purchaser.service.*;
import com.taxshare.purchaser.view.dto.*;
import com.taxshare.response.beans.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 *@ClassName: InvoiceReviewRulesController
 *@Description:发票审核规则(销项)
 *@author: hjh
 *@date:
 */
@RestController
@RequestMapping(value = "/invoice")
@Api(tags = "发票审核规则")
public class InvoiceReviewRulesController {

    @Autowired
    InvoiceReviewRulesService invoiceReviewRulesService;

    @Autowired
    private InvoiceBlackRulesService invoiceBlackRulesService;

    @Autowired
    private InvoiceBuyerRulesService invoiceBuyerRulesService;

    @Autowired
    private InvoiceSellerRulesService invoiceSellerRulesService;

    @Autowired
    private InvoiceWhiteRulesService invoiceWhiteRulesService;

    @Autowired
    private InvoiceGoodsRulesService invoiceGoodsRulesService;

    @Autowired
    private InvoiceTaxRulesService invoiceTaxRulesService;

    @Autowired
    private InvoiceAddressRulesService invoiceAddressRulesService;

    @RequestMapping(method = RequestMethod.POST, value = "/review/update")
    @ApiOperation(value = "发票审核规则添加/更新", notes = "发票审核规则")
    public Response addReviewRules(@RequestBody InvoiceReviewRulesDTO invoiceReviewRulesDTO) {
        return invoiceReviewRulesService.addReviewRules(invoiceReviewRulesDTO);
    }

    @RequestMapping(method = RequestMethod.POST, value = "/review/select")
    @ApiOperation(value = "查找发票审核规则", notes = "发票审核规则")
    public Response selectList() {
        return invoiceReviewRulesService.selectList();
    }

    @RequestMapping(method = RequestMethod.POST, value = "/review/selectById")
    @ApiOperation(value = "查找发票审核规则信息", notes = "发票审核规则")
    public Response selectListById(@RequestParam("uuid") String id) {
        return invoiceReviewRulesService.selectListById(id);
    }
    @RequestMapping(method = RequestMethod.POST, value = "/review/delete")
    @ApiOperation(value = "删除发票审核规则", notes = "发票审核规则")
    public Response deleteReviewRule(@RequestParam("uuid") String id) {
        return invoiceReviewRulesService.deleteReviewRule(id);
    }

    @RequestMapping(method = RequestMethod.POST,value = "/black/update/isOpen")
    @ApiOperation(value = "黑名单规则对isOpen更新", notes = "发票审核规则")
    public Response updateBlackIsOpen(@RequestBody InvoiceBlackRulesDTO invoiceBlackRulesDTO) {
        return invoiceBlackRulesService.updateBlackIsOpen(invoiceBlackRulesDTO);
    }
    @RequestMapping(method = RequestMethod.POST,value = "/buyer/update")
    @ApiOperation(value = "特殊购方规则对内容更新", notes = "发票审核规则")
    public Response updateSellerRules(@RequestBody InvoiceBuyerRulesDTO invoiceBuyerRulesDTO) {
        return invoiceBuyerRulesService.updateBuyerRules(invoiceBuyerRulesDTO);
    }
    @RequestMapping(method = RequestMethod.POST,value = "/buyer/update/isOpen")
    @ApiOperation(value = "特殊购方规则对isOpen更新", notes = "发票审核规则")
    public Response updateSellerIsOpen(@RequestBody InvoiceBuyerRulesDTO invoiceBuyerRulesDTO) {
        return invoiceBuyerRulesService.updateBuyerIsOpen(invoiceBuyerRulesDTO);
    }

    @RequestMapping(method = RequestMethod.POST,value = "/seller/update")
    @ApiOperation(value = "特定招待企业规则对内容更新", notes = "发票审核规则")
    public Response updateSellerRules(@RequestBody InvoiceSellerRulesDTO invoiceSellerRulesDTO) {
        return invoiceSellerRulesService.updateSellerRules(invoiceSellerRulesDTO);
    }

    @RequestMapping(method = RequestMethod.POST,value = "/seller/update/isOpen")
    @ApiOperation(value = "特定招待企业规则对isOpen更新", notes = "发票审核规则")
    public Response updateSellerIsOpen(@RequestBody InvoiceSellerRulesDTO invoiceSellerRulesDTO) {
        return invoiceSellerRulesService.updateSellerIsOpen(invoiceSellerRulesDTO);
    }

    @RequestMapping(method = RequestMethod.POST,value = "/white/update/isOpen")
    @ApiOperation(value = "白名单规则对isOpen更新", notes = "发票审核规则")
    public Response updateWhiteIsOpen(@RequestBody InvoiceWhiteRulesDTO invoiceWhiteRulesDTO) {
        return invoiceWhiteRulesService.updateWhiteIsOpen(invoiceWhiteRulesDTO);
    }

    @RequestMapping(method = RequestMethod.POST,value = "/goods/update")
    @ApiOperation(value = "商品明细规则对内容更新", notes = "发票审核规则")
    public Response updateGoodsRules(@RequestBody InvoiceGoodsRulesDTO invoiceGoodsRulesDTO) {
        return invoiceGoodsRulesService.updateGoodsRules(invoiceGoodsRulesDTO);
    }

    @RequestMapping(method = RequestMethod.POST,value = "/goods/update/isOpen")
    @ApiOperation(value = "商品明细规则对isOpen更新", notes = "发票审核规则")
    public Response updateGoodsIsOpen(@RequestBody InvoiceGoodsRulesDTO invoiceGoodsRulesDTO) {
        return invoiceGoodsRulesService.updateGoodsIsOpen(invoiceGoodsRulesDTO);
    }

    @RequestMapping(method = RequestMethod.POST, value = "/tax/update")
    @ApiOperation(value = "税号规则对内容更新", notes = "发票审核规则")
    public Response updateTaxRules(@RequestBody InvoiceTaxRulesDTO invoiceTaxRulesDTO) {
        return invoiceTaxRulesService.updateTaxRules(invoiceTaxRulesDTO);
    }

    @RequestMapping(method = RequestMethod.POST, value = "/tax/update/isOpen")
    @ApiOperation(value = "税号规则对isOpen更新", notes = "发票审核规则")
    public Response updateTaxIsOpen(@RequestBody InvoiceTaxRulesDTO invoiceTaxRulesDTO) {
        return invoiceTaxRulesService.updateTaxIsOpen(invoiceTaxRulesDTO);
    }

    @RequestMapping(method = RequestMethod.POST, value = "/tax/update/forceFlag")
    @ApiOperation(value = "税号规则对强制开关更新", notes = "发票审核规则")
    public Response updateTaxForceFlag(@RequestBody InvoiceTaxRulesDTO invoiceTaxRulesDTO) {
        return invoiceTaxRulesService.updateTaxForceFlag(invoiceTaxRulesDTO);
    }

    @RequestMapping(method = RequestMethod.POST, value = "/address/update")
    @ApiOperation(value = "用户手机地址银行账户规则对内容更新", notes = "发票审核规则")
    public Response updateAddressRules(@RequestBody InvoiceAddressRulesDTO invoiceAddressRulesDTO) {
        return invoiceAddressRulesService.updateAddressRules(invoiceAddressRulesDTO);
    }

    @RequestMapping(method = RequestMethod.POST, value = "/address/update/isOpen")
    @ApiOperation(value = "用户手机地址银行账户规则对isOpen更新", notes = "发票审核规则")
    public Response updateAddressIsOpen(@RequestBody InvoiceAddressRulesDTO invoiceAddressRulesDTO) {
        return invoiceAddressRulesService.updateAddressIsOpen(invoiceAddressRulesDTO);
    }

    @RequestMapping(method = RequestMethod.POST, value = "/address/update/forceFlag")
    @ApiOperation(value = "用户手机地址银行账户规则对强制开关更新", notes = "发票审核规则")
    public Response updateAddressForceFlag(@RequestBody InvoiceAddressRulesDTO invoiceAddressRulesDTO) {
        return invoiceAddressRulesService.updateAddressForceFlag(invoiceAddressRulesDTO);
    }

}
